import request from '/@/utils/request';

export function ossApi() {
    return {
        // 查询OSS对象存储列表
        listOss(data: object) {
            return request({
                url: '/oss/list',
                method: 'post',
                data: data
            })
        },
        // 查询OSS对象存储详细
        getOss(id: any) {
            return request({
                url: '/oss/' + id,
                method: 'get'
            })
        },
        // 查询OSS对象基于id串
        listByIds(id: any) {
            return request({
                url: '/oss/listByIds/' + id,
                method: 'get'
            })
        },
        // 查询OSS对象基于url串
        listByUrls(data: any) {
            return request({
                url: '/oss/listByUrls/',
                method: 'post',
                data: data
            })
        },
        // 新增OSS对象存储
        addOss(data: object) {
            return request({
                url: '/oss',
                method: 'post',
                data: data
            })
        },
        // 修改OSS对象存储
        updateOss(data: object) {
            return request({
                url: '/oss',
                method: 'put',
                data: data
            })
        },
        // 删除OSS对象存储
        delOss(data: object) {
            return request({
                url: '/oss',
                method: 'delete',
                data: data,
            })
        },
        exportRecord: (data: object) => {
            return request({
                url: '/oss/export',
                method: 'download',
                data: data
            });
        }
    }
}

